From 7162434ec1e202b1ed3d1b9e1bf82874bda0470a Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sun, 6 Apr 2008 11:53:24 +0000 Subject: [PATCH] new file defining BABL_DETECT_CFLAGS() macro. 2008-04-06 Sven Neumann * acinclude.m4: new file defining BABL_DETECT_CFLAGS() macro. * configure.ac: set CFLAGS to get some extra compiler warnings. * babl/babl-fish-stats.c (conversions): fixed old-style function definition. * Makefile.am: formatting. svn path=/trunk/; revision=303 --- ChangeLog | 11 +++++++++++ Makefile.am | 9 +++++---- acinclude.m4 | 20 ++++++++++++++++++++ babl/babl-fish-stats.c | 2 +- configure.ac | 20 ++++++++++++++++++++ 5 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 acinclude.m4 diff --git a/ChangeLog b/ChangeLog index 6287e31..550b4e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-04-06 Sven Neumann + + * acinclude.m4: new file defining BABL_DETECT_CFLAGS() macro. + + * configure.ac: set CFLAGS to get some extra compiler warnings. + + * babl/babl-fish-stats.c (conversions): fixed old-style function + definition. + + * Makefile.am: formatting. + 2008-04-02 Mukund Sivaraman Sparse fixes. diff --git a/Makefile.am b/Makefile.am index 511c639..0059faf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,9 +1,10 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 -SUBDIRS = babl \ - extensions \ - tests \ - docs +SUBDIRS = \ + babl \ + extensions \ + tests \ + docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = babl.pc diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..3fad630 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,20 @@ +dnl BABL_DETECT_CFLAGS(RESULT, FLAGSET) +dnl Detect if the compiler supports a set of flags + +AC_DEFUN([BABL_DETECT_CFLAGS], +[ + $1= + for flag in $2; do + if test -z "[$]$1"; then + $1_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $flag" + AC_MSG_CHECKING([whether [$]CC understands [$]flag]) + AC_TRY_COMPILE([], [], [$1_works=yes], [$1_works=no]) + AC_MSG_RESULT([$]$1_works) + CFLAGS="[$]$1_save_CFLAGS" + if test "x[$]$1_works" = "xyes"; then + $1="$flag" + fi + fi + done +]) diff --git a/babl/babl-fish-stats.c b/babl/babl-fish-stats.c index 52daf99..64dd768 100644 --- a/babl/babl-fish-stats.c +++ b/babl/babl-fish-stats.c @@ -231,7 +231,7 @@ each_conv (Babl *babl, } static void -conversions () +conversions (void) { fprintf (output_file, "

Conversions

\n"); babl_conversion_each (each_conv, NULL); diff --git a/configure.ac b/configure.ac index fada2b2..3e7a2cb 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,7 @@ AC_SUBST(WEBSITE_HOST) WEBSITE_LOCATION=public_html/babl/ AC_SUBST(WEBSITE_LOCATION) + if eval "test x$GCC = xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; @@ -112,6 +113,25 @@ if eval "test x$GCC = xyes"; then esac fi +BABL_DETECT_CFLAGS(extra_warnings, '-Wdeclaration-after-statement') +CFLAGS="$CFLAGS $extra_warnings" + +BABL_DETECT_CFLAGS(extra_warnings, '-Wmissing-prototypes') +CFLAGS="$CFLAGS $extra_warnings" + +BABL_DETECT_CFLAGS(extra_warnings, '-Wmissing-declarations') +CFLAGS="$CFLAGS $extra_warnings" + +BABL_DETECT_CFLAGS(extra_warnings, '-Winit-self') +CFLAGS="$CFLAGS $extra_warnings" + +BABL_DETECT_CFLAGS(extra_warnings, '-Wpointer-arith') +CFLAGS="$CFLAGS $extra_warnings" + +BABL_DETECT_CFLAGS(extra_warnings, '-Wold-style-definition') +CFLAGS="$CFLAGS $extra_warnings" + + AC_PATH_PROG(INKSCAPE, inkscape, no) AM_CONDITIONAL(HAVE_INKSCAPE, test "x$INKSCAPE" != "xno") -- 2.30.2